# 预设正确的账号和密码
correct_username = "admin"
correct_password = "123456"

# 初始尝试次数
attempts = 0
max_attempts = 3  # 最大尝试次数

while attempts < max_attempts:
    # 用户输入账号和密码
    username = input("请输入账号：")
    password = input("请输入密码：")
    
    # 验证账号密码
    if username == correct_username and password == correct_password:
        print("登录成功")
        break
    else:
        attempts += 1
        remaining = max_attempts - attempts
        print("用户名或密码错误，您还有{}次机会".format(remaining))

# 超过最大尝试次数
if attempts >= max_attempts:
    print("输入错误次数过多，请稍后再试")